<template>
  <div>
    <h1>供货订单查询</h1>

<!--    <el-input type="text" v-model="SQEName" placeholder="供应商" style="width: 10%"></el-input>
    <el-date-picker v-model="startTime" type="date" value-format="YYYY-MM-DD" style="width: 15%"
                    placeholder="起始日期">
    </el-date-picker>
    <el-date-picker v-model="endTime" type="date" value-format="YYYY-MM-DD" style="width: 15%"
                    placeholder="结束日期">
    </el-date-picker>
    <el-button type="primary" @click="query()">搜索</el-button>-->
    <br><br>
    <el-row>
      <el-table :data="goodsList" stripe>
        <el-table-column prop="contractNumber" label="合同编号"></el-table-column>
        <el-table-column prop="supplyNumber" label="供货订单编号"></el-table-column>
       <el-table-column label="商品规格" prop="goodsDetail" ></el-table-column>
        <el-table-column label="供应商编号" prop="supplierNumber" ></el-table-column>
        <el-table-column label="供应商名称" prop="supplierName" ></el-table-column>
        <el-table-column label="商品编号"   prop="goodsNumber"></el-table-column>

        <el-table-column label="商品数量" prop="goodsNum"></el-table-column>
        <el-table-column label="商品价格" prop="goodsPrice"></el-table-column>
        <el-table-column label="商品名字" prop="goodsName"></el-table-column>
        <el-table-column label="商品类型" prop="goodsType"></el-table-column>
        <el-table-column label="订单总价" prop="orderAllPrice"></el-table-column>

        <el-table-column label="供货状态" prop="supplyState">
          <template #default="scope">
            {{ this.covertStatus(scope.row.supplyState) }}
          </template>
        </el-table-column>
<!--
 <el-table-column label="操作">
          <template #default="scope">
            <el-button type="primary" @click="view(scope.row)"></el-button>
          </template>
        </el-table-column>
        -->
      </el-table>
      <el-pagination v-model:current-page="curPage" v-model:page-size="pageSize"
                     background :total="total" @current-change="changeCurPage()"></el-pagination>
    </el-row>

  </div>
</template>

<script>
import axios from "axios";

export default {
  name: "PurchaseInformationQuery",
  created() {
    this.query()
  },
  data() {
    return {
      goodsList:[],
      SQEList: [],
      SQEName: '',
      startTime: '',
      endTime: '',
      pick: false,
      form: {
        purchaseTime: '',
        supplierName: '',
        buyer:''
      },
      purchaseInfoList:[]
    }
  }, methods: {
    covertStatus(supplyState) {


      if (supplyState === 0) {
        return '未完成'
      }
      if (supplyState === 1) {
        return '已完成'
      }
      if (supplyState === 3) {
        return '已付款'
      }
    },

    query() {


      axios.post("/apf/supplyorder/selectSupplyOrder",null,{
        'headers': {'token': localStorage.getItem("token")}
      } ).then(res => {
        this.goodsList = res.data
      })


    },
    see(scope) {

      this.pick = true
      this.form = scope
      let param=new URLSearchParams()
      param.append('id',scope.purchaseId)

      axios.post("/api/PurchaseInfo/queryPurchaseInfoBean",param).then(res=>{
        this.purchaseInfoList=res.data
      })
    },
    determine(){
      this.pick = false
    },

  }
}
</script>

<style scoped>

</style>